package com.qf.security.provider;

import com.qf.core.provider.LoginUserProvider;
import com.qf.security.utils.SecurityUtils;
import org.springframework.stereotype.Component;

/**
 * @Author: sin
 * @Date: 2025/5/21 22:40
 * @Description:
 **/
@Component
public class SecurityLoginUserProvider implements LoginUserProvider {

    @Override
    public String getUsername() {
        return SecurityUtils.getUserInfo().getUsername();
    }

    @Override
    public Long getUserId() {
        return SecurityUtils.getUserInfo().getUser().getId();
    }
}
